from paralib.tasks import *
import celery
import numpy as np

res = add.delay(1,1)
print(res.ready())
print(res.get())

res = celery.group(add.s(i, 1) for i in range(8))()
print(res.get())

x = np.random.random_sample((3, 3))
y = np.random.random_sample((3, 3))
res = add.delay(x,y)
print(res.get())
print(x+y)
assert ((x+y) == res.get()).all()

# res = celery.chord((add.s(1,1), add.s(2,2)), add.s())()
# print(res.get())

l = [i for i in range(100)]
res = xsum.delay(l)
print(res.get())